<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/apps/snmp/snmp_asn1.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('snmp__asn1_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">snmp_asn1.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="snmp__opts_8h.html">lwip/apps/snmp_opts.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="snmp__asn1_8h.html">snmp_asn1.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af8e905a214936995d235789f359cf015"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#af8e905a214936995d235789f359cf015">snmp_ans1_enc_tlv</a> (struct snmp_pbuf_stream *pbuf_stream, struct snmp_asn1_tlv *tlv)</td></tr>
<tr class="separator:af8e905a214936995d235789f359cf015"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a167b707051bbbeafea14eeca72449ac6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a167b707051bbbeafea14eeca72449ac6">snmp_asn1_enc_raw</a> (struct snmp_pbuf_stream *pbuf_stream, const u8_t *raw, u16_t raw_len)</td></tr>
<tr class="separator:a167b707051bbbeafea14eeca72449ac6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa54b4ee3c58ef66721df96fd8b1f66b2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#aa54b4ee3c58ef66721df96fd8b1f66b2">snmp_asn1_enc_u32t</a> (struct snmp_pbuf_stream *pbuf_stream, u16_t octets_needed, u32_t value)</td></tr>
<tr class="separator:aa54b4ee3c58ef66721df96fd8b1f66b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25b3fe21becd08260ec56bef9299d3c6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a25b3fe21becd08260ec56bef9299d3c6">snmp_asn1_enc_s32t</a> (struct snmp_pbuf_stream *pbuf_stream, u16_t octets_needed, s32_t value)</td></tr>
<tr class="separator:a25b3fe21becd08260ec56bef9299d3c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa71260abd46fc2f682874016896fe218"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#aa71260abd46fc2f682874016896fe218">snmp_asn1_enc_oid</a> (struct snmp_pbuf_stream *pbuf_stream, const u32_t *oid, u16_t oid_len)</td></tr>
<tr class="separator:aa71260abd46fc2f682874016896fe218"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20343aef4524459a2b45704e18ef520d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a20343aef4524459a2b45704e18ef520d">snmp_asn1_enc_length_cnt</a> (u16_t length, u8_t *octets_needed)</td></tr>
<tr class="separator:a20343aef4524459a2b45704e18ef520d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58965e0305884d550786440c84119ad4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a58965e0305884d550786440c84119ad4">snmp_asn1_enc_u32t_cnt</a> (u32_t value, u16_t *octets_needed)</td></tr>
<tr class="separator:a58965e0305884d550786440c84119ad4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c74914532f1e0c219dfb1977fd0c22f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a8c74914532f1e0c219dfb1977fd0c22f">snmp_asn1_enc_s32t_cnt</a> (s32_t value, u16_t *octets_needed)</td></tr>
<tr class="separator:a8c74914532f1e0c219dfb1977fd0c22f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6fd58c1b41cb98117f00a11db7d226f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#ab6fd58c1b41cb98117f00a11db7d226f">snmp_asn1_enc_oid_cnt</a> (const u32_t *oid, u16_t oid_len, u16_t *octets_needed)</td></tr>
<tr class="separator:ab6fd58c1b41cb98117f00a11db7d226f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e3f63b155b06f7ade627060b55e4496"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a7e3f63b155b06f7ade627060b55e4496">snmp_asn1_dec_tlv</a> (struct snmp_pbuf_stream *pbuf_stream, struct snmp_asn1_tlv *tlv)</td></tr>
<tr class="separator:a7e3f63b155b06f7ade627060b55e4496"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac04e08c19c40cfc3333a181018887a51"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#ac04e08c19c40cfc3333a181018887a51">snmp_asn1_dec_u32t</a> (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value)</td></tr>
<tr class="separator:ac04e08c19c40cfc3333a181018887a51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51d36daf2935c246eb55fb749581e2bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a51d36daf2935c246eb55fb749581e2bb">snmp_asn1_dec_s32t</a> (struct snmp_pbuf_stream *pbuf_stream, u16_t len, s32_t *value)</td></tr>
<tr class="separator:a51d36daf2935c246eb55fb749581e2bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bb84ec51c46a890b7ced016043b2908"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a8bb84ec51c46a890b7ced016043b2908">snmp_asn1_dec_oid</a> (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *oid, u8_t *oid_len, u8_t oid_max_len)</td></tr>
<tr class="separator:a8bb84ec51c46a890b7ced016043b2908"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31055a35285214ea0d4ad60c64c2f73e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="snmp__asn1_8c.html#a31055a35285214ea0d4ad60c64c2f73e">snmp_asn1_dec_raw</a> (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u8_t *buf, u16_t *buf_len, u16_t buf_max_len)</td></tr>
<tr class="separator:a31055a35285214ea0d4ad60c64c2f73e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Abstract Syntax Notation One (ISO 8824, 8825) encoding</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="af8e905a214936995d235789f359cf015"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8e905a214936995d235789f359cf015">&#9670;&nbsp;</a></span>snmp_ans1_enc_tlv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_ans1_enc_tlv </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct snmp_asn1_tlv *&#160;</td>
          <td class="paramname"><em>tlv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encodes a TLV into a pbuf stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">tlv</td><td>TLV to encode </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) encode </dd></dl>

</div>
</div>
<a id="a8bb84ec51c46a890b7ced016043b2908"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8bb84ec51c46a890b7ced016043b2908">&#9670;&nbsp;</a></span>snmp_asn1_dec_oid()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_dec_oid </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32_t *&#160;</td>
          <td class="paramname"><em>oid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8_t *&#160;</td>
          <td class="paramname"><em>oid_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>oid_max_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decodes object identifier from incoming message into array of u32_t.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">len</td><td>length of the coded object identifier </td></tr>
    <tr><td class="paramname">oid</td><td>return decoded object identifier </td></tr>
    <tr><td class="paramname">oid_len</td><td>return decoded object identifier length </td></tr>
    <tr><td class="paramname">oid_max_len</td><td>size of oid buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) decode </dd></dl>

</div>
</div>
<a id="a31055a35285214ea0d4ad60c64c2f73e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31055a35285214ea0d4ad60c64c2f73e">&#9670;&nbsp;</a></span>snmp_asn1_dec_raw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_dec_raw </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t *&#160;</td>
          <td class="paramname"><em>buf_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>buf_max_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decodes (copies) raw data (ip-addresses, octet strings, opaque encoding) from incoming message into array.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">len</td><td>length of the coded raw data (zero is valid, e.g. empty string!) </td></tr>
    <tr><td class="paramname">buf</td><td>return raw bytes </td></tr>
    <tr><td class="paramname">buf_len</td><td>returns length of the raw return value </td></tr>
    <tr><td class="paramname">buf_max_len</td><td>buffer size </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) decode </dd></dl>

</div>
</div>
<a id="a51d36daf2935c246eb55fb749581e2bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51d36daf2935c246eb55fb749581e2bb">&#9670;&nbsp;</a></span>snmp_asn1_dec_s32t()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_dec_s32t </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">s32_t *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decodes integer into s32_t.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">len</td><td>length of the coded integer field </td></tr>
    <tr><td class="paramname">value</td><td>return host order integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) decode</dd></dl>
<dl class="section note"><dt>Note</dt><dd>ASN coded integers are <em>always</em> signed! </dd></dl>

</div>
</div>
<a id="a7e3f63b155b06f7ade627060b55e4496"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e3f63b155b06f7ade627060b55e4496">&#9670;&nbsp;</a></span>snmp_asn1_dec_tlv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_dec_tlv </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct snmp_asn1_tlv *&#160;</td>
          <td class="paramname"><em>tlv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decodes a TLV from a pbuf stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">tlv</td><td>returns decoded TLV </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_VAL if we can't decode </dd></dl>

</div>
</div>
<a id="ac04e08c19c40cfc3333a181018887a51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac04e08c19c40cfc3333a181018887a51">&#9670;&nbsp;</a></span>snmp_asn1_dec_u32t()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_dec_u32t </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32_t *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decodes positive integer (counter, gauge, timeticks) into u32_t.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">len</td><td>length of the coded integer field </td></tr>
    <tr><td class="paramname">value</td><td>return host order integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) decode</dd></dl>
<dl class="section note"><dt>Note</dt><dd>ASN coded integers are <em>always</em> signed. E.g. +0xFFFF is coded as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!! </dd></dl>

</div>
</div>
<a id="a20343aef4524459a2b45704e18ef520d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20343aef4524459a2b45704e18ef520d">&#9670;&nbsp;</a></span>snmp_asn1_enc_length_cnt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void snmp_asn1_enc_length_cnt </td>
          <td>(</td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8_t *&#160;</td>
          <td class="paramname"><em>octets_needed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns octet count for length.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">length</td><td>parameter length </td></tr>
    <tr><td class="paramname">octets_needed</td><td>points to the return value </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aa71260abd46fc2f682874016896fe218"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa71260abd46fc2f682874016896fe218">&#9670;&nbsp;</a></span>snmp_asn1_enc_oid()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_enc_oid </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32_t *&#160;</td>
          <td class="paramname"><em>oid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>oid_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encodes object identifier into a pbuf chained ASN1 msg.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">oid</td><td>points to object identifier array </td></tr>
    <tr><td class="paramname">oid_len</td><td>object identifier array length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) encode </dd></dl>

</div>
</div>
<a id="ab6fd58c1b41cb98117f00a11db7d226f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6fd58c1b41cb98117f00a11db7d226f">&#9670;&nbsp;</a></span>snmp_asn1_enc_oid_cnt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void snmp_asn1_enc_oid_cnt </td>
          <td>(</td>
          <td class="paramtype">const u32_t *&#160;</td>
          <td class="paramname"><em>oid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>oid_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t *&#160;</td>
          <td class="paramname"><em>octets_needed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns octet count for an object identifier.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">oid</td><td>points to object identifier array </td></tr>
    <tr><td class="paramname">oid_len</td><td>object identifier array length </td></tr>
    <tr><td class="paramname">octets_needed</td><td>points to the return value </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a167b707051bbbeafea14eeca72449ac6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a167b707051bbbeafea14eeca72449ac6">&#9670;&nbsp;</a></span>snmp_asn1_enc_raw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_enc_raw </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u8_t *&#160;</td>
          <td class="paramname"><em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>raw_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encodes raw data (octet string, opaque) into a pbuf chained ASN1 msg.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">raw_len</td><td>raw data length </td></tr>
    <tr><td class="paramname">raw</td><td>points raw data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) encode </dd></dl>

</div>
</div>
<a id="a25b3fe21becd08260ec56bef9299d3c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25b3fe21becd08260ec56bef9299d3c6">&#9670;&nbsp;</a></span>snmp_asn1_enc_s32t()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_enc_s32t </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>octets_needed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">s32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encodes s32_t integer into a pbuf chained ASN1 msg.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">octets_needed</td><td>encoding length (from <a class="el" href="snmp__asn1_8c.html#a8c74914532f1e0c219dfb1977fd0c22f">snmp_asn1_enc_s32t_cnt()</a>) </td></tr>
    <tr><td class="paramname">value</td><td>is the host order s32_t value to be encoded </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) encode</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="snmp__asn1_8c.html#a8c74914532f1e0c219dfb1977fd0c22f">snmp_asn1_enc_s32t_cnt()</a> </dd></dl>

</div>
</div>
<a id="a8c74914532f1e0c219dfb1977fd0c22f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c74914532f1e0c219dfb1977fd0c22f">&#9670;&nbsp;</a></span>snmp_asn1_enc_s32t_cnt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void snmp_asn1_enc_s32t_cnt </td>
          <td>(</td>
          <td class="paramtype">s32_t&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t *&#160;</td>
          <td class="paramname"><em>octets_needed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns octet count for an s32_t.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>value to be encoded </td></tr>
    <tr><td class="paramname">octets_needed</td><td>points to the return value</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>ASN coded integers are <em>always</em> signed. </dd></dl>

</div>
</div>
<a id="aa54b4ee3c58ef66721df96fd8b1f66b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa54b4ee3c58ef66721df96fd8b1f66b2">&#9670;&nbsp;</a></span>snmp_asn1_enc_u32t()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> snmp_asn1_enc_u32t </td>
          <td>(</td>
          <td class="paramtype">struct snmp_pbuf_stream *&#160;</td>
          <td class="paramname"><em>pbuf_stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>octets_needed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encodes u32_t (counter, gauge, timeticks) into a pbuf chained ASN1 msg.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pbuf_stream</td><td>points to a pbuf stream </td></tr>
    <tr><td class="paramname">octets_needed</td><td>encoding length (from <a class="el" href="snmp__asn1_8c.html#a58965e0305884d550786440c84119ad4">snmp_asn1_enc_u32t_cnt()</a>) </td></tr>
    <tr><td class="paramname">value</td><td>is the host order u32_t value to be encoded </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_ARG if we can't (or won't) encode</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="snmp__asn1_8c.html#a58965e0305884d550786440c84119ad4">snmp_asn1_enc_u32t_cnt()</a> </dd></dl>

</div>
</div>
<a id="a58965e0305884d550786440c84119ad4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a58965e0305884d550786440c84119ad4">&#9670;&nbsp;</a></span>snmp_asn1_enc_u32t_cnt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void snmp_asn1_enc_u32t_cnt </td>
          <td>(</td>
          <td class="paramtype">u32_t&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t *&#160;</td>
          <td class="paramname"><em>octets_needed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns octet count for an u32_t.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>value to be encoded </td></tr>
    <tr><td class="paramname">octets_needed</td><td>points to the return value</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>ASN coded integers are <em>always</em> signed. E.g. +0xFFFF is coded as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!! </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_53adf0b982dc8545998aae3f283a5a58.html">apps</a></li><li class="navelem"><a class="el" href="dir_fb3f7e43f39ddb210bd1444e66d055f1.html">snmp</a></li><li class="navelem"><a class="el" href="snmp__asn1_8c.html">snmp_asn1.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
